/*
 * 文件名：FormController.java
 * 版权：Copyright by www.ixuenong.com
 * 描述：
 */

package com.pointlion.sys.mvc.admin.workflow.form;

import java.util.List;

import org.activiti.engine.FormService;
import org.activiti.engine.form.FormProperty;
import org.activiti.engine.form.TaskFormData;

import com.pointlion.sys.mvc.common.base.BaseController;
import com.pointlion.sys.plugin.activiti.ActivitiPlugin;

/**
 * 
 * 自定义表单
 * 
 * @author clatt
 * @since 2018年12月4日
 */
public class FormController extends BaseController
{
    
    /**
     * 
     * 根据form内容生成页面表单
     */
    public void generate()
    {
        String taskId = getPara("taskId");
        FormService formService = ActivitiPlugin.buildProcessEngine().getFormService();
        TaskFormData taskFormData = formService.getTaskFormData(taskId);
        List<FormProperty> formProperties = taskFormData.getFormProperties();
        for(FormProperty p : formProperties)
        {
            p.getId();
            p.getName();
            p.getType();
            p.getValue();
        }
    }
}
